package ar.uba.fi.tonyvaliente.documents;

import java.util.Iterator;

public class DocumentTermFilter extends DocumentFilter {
	
	private String term;

	public DocumentTermFilter(String term, boolean negated) {
		super(negated);
		this.term = term;
	}

	public String getTerm() {
		return term;
	}

	protected ResultIterator createResultIterator(int totalDocumentos) {
		return new DocumentTermResultIterator(term, totalDocumentos);
	}


	private class DocumentTermResultIterator extends ResultIterator {

		private Iterator<Integer> idIterator;
		
		public DocumentTermResultIterator(String term, int totalDocumentos) {
			super(totalDocumentos);
			this.idIterator = getDocumentIDsIterator(term);
		}

		public boolean hasNext() {
			return idIterator.hasNext();
		}

		public Integer next() {
			return idIterator.next();
		}

		private Iterator<Integer> getDocumentIDsIterator(String term) {
			// TODO: implementar!!
			return null;
		}
	}
}

